<?php
namespace app\index\controller;
use think\Db;
class Index extends \think\Controller
{
    public function index()
    {

        return view();
    }
    public function register(){
        $customerName = trim(input("customerName"));
        $mobile = trim(input("mobile"));
        $gender = trim(input("gender"));
        $provinceCode = trim(input("provinceCode"));
        $cityCode = trim(input("cityCode"));
        $dealerCode = trim(input("dealerCode"));
        $modelCode = trim(input("modelCode"));
        $seriesCode = trim(input("seriesCode"));
        $data = [
            "customerName"=>$customerName,
            "mobile"=>$mobile,
            "gender"=>$gender,
            "provinceCode"=>$provinceCode,
            "cityCode"=>$cityCode,
            "modelCode"=>$modelCode,
            "dealerCode"=>$dealerCode,
            "seriesCode"=>$seriesCode
        ];
        $res = Db::table("register")->insert($data);
        if($res==0){
            return returnData(0,"数据保存失败",null);
        }else{
            return returnData(1,"数据保存成功",null);
        }
    }
}
